package com.gsk.test123.service.impl;

import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.baomidou.mybatisplus.plugins.Page;
import com.gsk.test123.config.DataSourceType;
import com.gsk.test123.config.JdbcContextHolder;
import com.gsk.test123.entity.DataTimeParam;
import com.gsk.test123.mapper.DataTimeParamMapper;
import com.gsk.test123.service.DataTimeParamService;
import com.baomidou.mybatisplus.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author jrw
 * @since 2018-06-22
 */
@Service
public class DataTimeParamServiceImpl extends ServiceImpl<DataTimeParamMapper, DataTimeParam> implements DataTimeParamService {
    @Autowired
    private DataTimeParamMapper dataTimeParamMapper;

    @Override
    public List<DataTimeParam> findall() {
//        JdbcContextHolder.putDataSource(DataSourceType.Master);
        return dataTimeParamMapper.selectPage(new Page<DataTimeParam>(0,10),
                new EntityWrapper<DataTimeParam>().eq("id", 1));
    }
}
